home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C & C++ Multimedia Cyber Classroom
/
C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso
/
src
/
fig05_34.jar
/
Ch05
/
Fig05_34
/
Fig05_34.cpp
next >
Wrap
C/C++ Source or Header
|
1997-10-14
|
504b
|
23 lines
// Fig. 5.34: fig05_34.cpp
// Using strlen
#include <iostream.h>
#include <string.h>
int main()
{
char *string1 = "abcdefghijklmnopqrstuvwxyz";
char *string2 = "four";
char *string3 = "Boston";
cout << "The length of \"" << string1
<< "\" is " << strlen( string1 )
<< "\nThe length of \"" << string2
<< "\" is " << strlen( string2 )
<< "\nThe length of \"" << string3
<< "\" is " << strlen( string3 ) << endl;
return 0;
}